from base.baseBage import basePage
from common.base_driver import init_driver
from selenium.webdriver.common.by import By
from time import sleep
class LifePage(basePage):
    search_box= "输入商家名称"
    imput_search_box=(By.CLASS_NAME,'android.widget.EditText')
    fenzhidu="粉之都"

    #点击搜索框
    def search_business(self):
        return self.find_uiautomator(self.search_box).click()

    # 搜索框输入粉之都
    def imput_search_business(self):
        return self.find_element(self.imput_search_box).send_keys("粉之都")

    def click_search(self):
        '''点击搜索'''
        return self.touch_tap(800,250)

    def search_click_fenzhidu(self):
        '''点击粉之都'''
        self.find_uiautomator(self.fenzhidu,instance=1).click()




if __name__ == '__main__':
    LP=LifePage()
    LP.find_uiautomator("进入应用").click()
    sleep(7)
    LP.slide_toUp(second=2)
    # LP.search_business()
    # LP.imput_search_business()
    # LP.touch_tap(800,250)
    # LP.find_uiautomator("粉之都",instance=1).click()

